package com.yyks.es.dubbo.pojo.vo;

import cn.hutool.json.JSONUtil;
import com.yeyks.hotel.dal.domain.RoomInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class HotelInfoHotelSearchHotelInfoRoomInfoVo extends RoomInfo {

    @ApiModelProperty("最低售价")
    private Integer salePrice;
    @ApiModelProperty("房间数")
    private Integer roomCount;

    //图片url
    public List<String> getImages() {
        try {
            return JSONUtil.parseObj(getExtraInfo()).getJSONArray("imgUrlList").toList(String.class);
        } catch (Exception e) {
            return new ArrayList<>();
        }
    }

}
